package com.dgshanger.sanhxiaofeisc.mvp.model

import com.dgshanger.sanhxiaofeisc.common.AppApi
import com.dgshanger.sanhxiaofeisc.mvp.contract.EditNicknameContract
import com.xx.baseutilslibrary.network.rx.RxHelper
import com.xx.baseutilslibrary.network.rx.RxHttpObserver

/**
 * EditNicknameModel
 * 沉迷学习不能自拔
 * Describe：
 * Created by 雷小星🍀 on 2018/4/20 15:31.
 */

class EditNicknameModel : EditNicknameContract.Model {

    override fun editNickname(nickName: String, httpObserver: RxHttpObserver<Any>) {
        AppApi.Api()
                .name_store(nickName)
                .compose(RxHelper.io_main())
                .subscribe(httpObserver)

//        Observable.timer(1500, TimeUnit.MILLISECONDS)
//                .flatMap { Observable.just(BaseResponseEntity<Any>(1, "修改成功")) }
//                .compose(RxHelper.io_main())
//                .compose(RxHelper.start_finish(httpObserver))
//                .subscribe(httpObserver)
    }
}
